
<template>
  <div class="common-layout" >
    <el-container >
      <el-header>
        <div class="header-content">
          <img  style="height: 150px;width: 150px" src="@/logo.png" alt="Logo" class="header-logo">
          <div>
            <img src="@/img.png" alt="Logo-text" style="height: 45px;margin-top: 30px" class="header-logotext">
            <p STYLE="width: 1000px;margin-left: 10px;margin-top: 10px">NEUSOFT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SMART&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COMMUNITY</p>
          </div>
          <div class="avatar" >
            <el-avatar :size="55" :icon="UserFilled" />
          </div>
        </div>
      </el-header>
      <el-container>
        <el-aside class="aside" >
          <el-menu router default-active="1">
            <el-menu-item style="height: 100px" index="goods-management" class="first">
              <el-icon><location /></el-icon>
              <span>商品管理</span>
            </el-menu-item>
            <el-menu-item style="height: 100px"index="area-management">
              <el-icon><icon-menu /></el-icon>
              <span>服务区管理</span>
            </el-menu-item>
            <el-menu-item style="height: 100px"index="shop-management">
              <el-icon><document /></el-icon>
              <span>门店管理</span>
            </el-menu-item>
            <el-menu-item style="height: 100px"index="order-management">
              <el-icon><setting /></el-icon>
              <span>订单管理</span>
            </el-menu-item>
            <el-menu-item style="height: 100px"index="rank-management">
              <el-icon><setting /></el-icon>
              <span>商品销售排行</span>
            </el-menu-item>
            <el-menu-item style="height: 100px"index="visitorrank-management">
              <el-icon><setting /></el-icon>
              <span>商品访客排行</span>
            </el-menu-item>

          </el-menu>
        </el-aside>

        <el-main class="main">
          <div class="m-4">
            <h2 style="margin-left: 80px;margin-top: 40px">商品分类</h2>
            <el-divider></el-divider>
            <el-cascader
                placeholder="请输入类别"
                :options="options"
                :props="props"
                filterable
            />
            <el-button style="margin-right: 20px" class="button1" type="button">添加商品</el-button>
            <el-button style="margin-right: 20px" class="button2" type="button">删除商品</el-button>
          </div>
          <el-table :data="tableData" style="width: 100%">
            <el-table-column fixed prop="date" label="日期" width="150" />
            <el-table-column  prop="name" label="商品名称" width="150" />
            <el-table-column  prop="location" label="位置" width="150" />
            <el-table-column  prop="price" label="价格" width="150" />
            <el-table-column  prop="introduction" label="简介" width="600" />
            <el-table-column  fixed="right" label="操作" width="200">
              <template #default>
                <el-button link type="primary" size="small" @click="handleClick">
                  详情
                </el-button>
                <el-button class="yichu" style="margin-left: 50px" link type="primary" size="small">移除类别</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-main>

      </el-container>
    </el-container>
  </div>
</template>

<script setup>
import { UserFilled } from '@element-plus/icons-vue'
import {
  View,
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'
const props = defineProps({
  multiple: Boolean,

})
const handleClick = () => {
  console.log('click')
}
const tableData = [
  {
    date: '2016-05-03',
    name: 'Tom',
    location: 'California',
    price: 'Los Angeles',
    introduction: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-03',
    name: 'Tom',
    location: 'California',
    price: 'Los Angeles',
    introduction: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-03',
    name: 'Tom',
    location: 'California',
    price: 'Los Angeles',
    introduction: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-03',
    name: 'Tom',
    location: 'California',
    price: 'Los Angeles',
    introduction: 'No. 189, Grove St, Los Angeles',
  },
]

const options = [
  {
    value: 'guide',
    label: 'Guide',
    children: [
      {
        value: 'disciplines',
        label: 'Disciplines',
        children: [
          {
            value: 'consistency',
            label: 'Consistency',
          },
          {
            value: 'feedback',
            label: 'Feedback',
          },
          {
            value: 'efficiency',
            label: 'Efficiency',
          },
          {
            value: 'controllability',
            label: 'Controllability',
          },
        ],
      },
      {
        value: 'navigation',
        label: 'Navigation',
        children: [
          {
            value: 'side nav',
            label: 'Side Navigation',
          },
          {
            value: 'top nav',
            label: 'Top Navigation',
          },
        ],
      },
    ],
  },
  {
    value: 'component',
    label: 'Component',
    children: [
      {
        value: 'basic',
        label: 'Basic',
        children: [
          {
            value: 'layout',
            label: 'Layout',
          },
          {
            value: 'color',
            label: 'Color',
          },
          {
            value: 'typography',
            label: 'Typography',
          },
          {
            value: 'icon',
            label: 'Icon',
          },
          {
            value: 'button',
            label: 'Button',
          },
        ],
      },
      {
        value: 'form',
        label: 'Form',
        children: [
          {
            value: 'radio',
            label: 'Radio',
          },
          {
            value: 'checkbox',
            label: 'Checkbox',
          },
          {
            value: 'input',
            label: 'Input',
          },
          {
            value: 'input-number',
            label: 'InputNumber',
          },
          {
            value: 'select',
            label: 'Select',
          },
          {
            value: 'cascader',
            label: 'Cascader',
          },
          {
            value: 'switch',
            label: 'Switch',
          },
          {
            value: 'slider',
            label: 'Slider',
          },
          {
            value: 'time-picker',
            label: 'TimePicker',
          },
          {
            value: 'date-picker',
            label: 'DatePicker',
          },
          {
            value: 'datetime-picker',
            label: 'DateTimePicker',
          },
          {
            value: 'upload',
            label: 'Upload',
          },
          {
            value: 'rate',
            label: 'Rate',
          },
          {
            value: 'form',
            label: 'Form',
          },
        ],
      },
      {
        value: 'data',
        label: 'Data',
        children: [
          {
            value: 'table',
            label: 'Table',
          },
          {
            value: 'tag',
            label: 'Tag',
          },
          {
            value: 'progress',
            label: 'Progress',
          },
          {
            value: 'tree',
            label: 'Tree',
          },
          {
            value: 'pagination',
            label: 'Pagination',
          },
          {
            value: 'badge',
            label: 'Badge',
          },
        ],
      },
      {
        value: 'notice',
        label: 'Notice',
        children: [
          {
            value: 'alert',
            label: 'Alert',
          },
          {
            value: 'loading',
            label: 'Loading',
          },
          {
            value: 'message',
            label: 'Message',
          },
          {
            value: 'message-box',
            label: 'MessageBox',
          },
          {
            value: 'notification',
            label: 'Notification',
          },
        ],
      },
      {
        value: 'navigation',
        label: 'Navigation',
        children: [
          {
            value: 'menu',
            label: 'Menu',
          },
          {
            value: 'tabs',
            label: 'Tabs',
          },
          {
            value: 'breadcrumb',
            label: 'Breadcrumb',
          },
          {
            value: 'dropdown',
            label: 'Dropdown',
          },
          {
            value: 'steps',
            label: 'Steps',
          },
        ],
      },
      {
        value: 'others',
        label: 'Others',
        children: [
          {
            value: 'dialog',
            label: 'Dialog',
          },
          {
            value: 'tooltip',
            label: 'Tooltip',
          },
          {
            value: 'popover',
            label: 'Popover',
          },
          {
            value: 'card',
            label: 'Card',
          },
          {
            value: 'carousel',
            label: 'Carousel',
          },
          {
            value: 'collapse',
            label: 'Collapse',
          },
        ],
      },
    ],
  },
  {
    value: 'resource',
    label: 'Resource',
    children: [
      {
        value: 'axure',
        label: 'Axure Components',
      },
      {
        value: 'sketch',
        label: 'Sketch Templates',
      },
      {
        value: 'docs',
        label: 'Design Documentation',
      },
    ],
  },
]
</script>
<style scoped>
.common-layout {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden; /* 隐藏滚动条 */
}
.avatar{
margin-left: 400px;
}
.header-logo {
  float: left;
  width: 100px;
  height: auto;
  margin-top: 10px;
  margin-left: -175px;
}
.header-logotext{
  margin-top: 40px;
}
.header-content {
  display: flex;
  align-items: center;
  border-width: 1px;
  border-bottom-style: groove;
  border-bottom-color:#cccccc;
  position: absolute;
  left: 10%; /* 图片和标题距离左侧20% */
  width: 100%; /* 可根据实际情况调整，确保内容不会溢出 */
}

.aside {
  position: absolute;
  top: 160px;
  left: 0;
  bottom: 0;
  width: 200px;
  height: calc(100% - 60px);
  border: 1px solid #ccc;
}
span {
  font-size: 18px;
}
.first{
  margin-top: 0px;
}
.main {
  flex: 1; /* main占据剩余空间 */
  border-radius: 4px;
  position: absolute;
  top: 150px;
  left: 200px;
  right: 0;
  bottom: 0;
}
.el-header {
  flex: 0 0 15%; /* header占据20%高度，且不缩放 */
  line-height: 1; /* 重置line-height，避免继承影响 */
  align-items: center; /* 垂直居中 */
  justify-content: space-between; /* 调整为两端对齐，以便在两侧放置元素 */
  padding: 0px 20px; /* 添加内边距以防止内容贴近边缘 */
}
.category-menu {
  list-style-type: none;
  padding-left: 0;
}

.category-menu li {
  margin-bottom: 10px;
}

.category-menu li.active {
  font-weight: bold;
}
.button1 {
  width: 80px;
  height: 30px;
  color: white;
  background: dodgerblue;
  margin-left: 950px;
}
.button2 {
  width: 80px;
  height: 30px;
  margin-right: 30px; /* 根据需要调整间距 */
  color: white;
  background:red;
}
.yichu{
  color: red;
}
</style>